/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.user.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 *
 *
 * @date 2022-08-16 10:43:30
 */
@Data
@TableName("agent_user")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "")
public class AgentUser extends Model<AgentUser> {

    private static final long serialVersionUID = 1L;

    /**
     * 系统id
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value="系统id")
	@JsonSerialize(using = ToStringSerializer.class)
    private Long sysId;

    /**
     * 经纪人id
     */
    @ApiModelProperty(value="经纪人id")
	@JsonSerialize(using = ToStringSerializer.class)
    private Long agentUid;

    /**
     * 客户邀请码
     */
    @ApiModelProperty(value="客户邀请码")
    private String inviteCode;

    /**
     * 账户状态（0=正常，1=禁用 ）
     */
    @ApiModelProperty(value="账户状态（0=正常，1=禁用 ）")
    private Integer status;

    /**
     * 创建时间
     */
    @ApiModelProperty(value="创建时间")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty(value="修改时间")
    private LocalDateTime updateTime;

    /**
     * 最后登录时间
     */
    @ApiModelProperty(value="最后登录时间")
    private LocalDateTime lastTime;

    /**
     * 最后登录IP
     */
    @ApiModelProperty(value="最后登录IP")
    private String lastIp;

    /**
     * 逻辑删除标志
     */
    @ApiModelProperty(value="逻辑删除标志")
    private String delFlag;

    /**
     * 是否确认风险告知 0否 1是
     */
    @ApiModelProperty(value="是否确认风险告知 0否 1是")
    private Integer isConfrimRisk;

    /**
     * 邮箱
     */
    @ApiModelProperty(value="邮箱")
    private String email;

    /**
     * 授权公链
     */
    @ApiModelProperty(value="授权公链")
    private String chain;

    /**
     * 授权地址
     */
    @ApiModelProperty(value="授权地址")
    private String address;

    /**
     * 地址签名原文
     */
    @ApiModelProperty(value="地址签名原文")
    private String signatureMessage;

    /**
     * 资金密码
     */
    @ApiModelProperty(value="资金密码")
    private String moneyPassword;

	/**
	 * 平台返佣比例
	 */
	@ApiModelProperty(value="平台返佣比例")
	private Integer commissionPercentage;

	/**
	 * 钱包地址
	 */
	@ApiModelProperty(value="钱包地址")
	private String walletAddress;

	/**
	 * 系统用户登录账号
	 */
	@TableField(exist = false)
	private String userName;

	/**
	 * 系统用户登录密码
	 */
	@TableField(exist = false)
	private String password;

	public AgentUser(User user) {
		this.agentUid = user.getUid();
		this.inviteCode = user.getInviteCode();
		this.status = user.getStatus();
		this.createTime = user.getCreateTime();
		this.updateTime = user.getUpdateTime();
		this.lastTime = user.getLastTime();
		this.lastIp = user.getLastIp();
		this.delFlag = user.getDelFlag();
		this.isConfrimRisk = user.getIsConfrimRisk();
		this.email = user.getEmail();
		this.chain = user.getChain();
		this.address = user.getAddress();
		this.moneyPassword = user.getMoneyPassword();
		this.walletAddress = user.getAddress();
		this.userName = user.getUserName();
		this.password = user.getPassword();
	}
}
